/******************************************************************************
 * @File name   :      IPackageInventoryService.java
 *
 * @Author      :      JIZHANGS
 *
 * @Date        :      Jul 22, 2015
 *
 * @Copyright Notice: 
 * Copyright (c) 2015 Capgemini, Inc. All  Rights Reserved.
 * This software is published under the terms of the Capgemini Software
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 * 
 * 
 * ----------------------------------------------------------------------------
 * Date                   Who         Version        Comments
 * Jul 22, 2015 11:40:05 AM        JIZHANGS     1.0            Initial Version
 *****************************************************************************/
package com.cap.bts.crmdp.dealer.remind.service;

import java.io.File;
import java.util.List;
import java.util.Map;

import com.cap.bts.crmdp.commons.sftp.SftpProperties;
import com.cap.bts.crmdp.dealer.masterdata.domain.MasterDataDealerInfo;
import com.cap.bts.crmdp.dealer.remind.domain.CustomPromotion;
import com.cap.bts.crmdp.dealer.remind.domain.CustomerGroup;
import com.cap.bts.crmdp.dealer.remind.domain.HQPromotion;
import com.cap.bts.crmdp.dealer.remind.domain.RemindQuota;
import com.cap.bts.crmdp.dealer.remind.domain.ServiceRemind;
import com.cap.bts.crmdp.dealer.remind.dto.CustomerPromotionDto;
import com.cap.bts.crmdp.dealer.remind.dto.MsgPackageDto;
import com.cap.bts.crmdp.dealer.remind.dto.RemindDto;
import com.cap.bts.crmdp.dealer.remind.dto.RemindSettingsDto;
import com.cap.bts.crmdp.dealer.remind.dto.ServiceRemindDto;
import com.cap.bts.crmdp.dealer.remind.dto.ServiceRemindForMemberDto;
import com.cap.bts.crmdp.dealer.remind.dto.ServiceRemindHistoryDto;
import com.cap.bts.crmdp.dealer.remind.dto.ServiceRemindSubmitDto;
import com.cap.bts.crmdp.dealer.remind.dto.SftpFileDto;
import com.cap.bts.framework.common.exception.AppException;

/**
 *
 */
/**
 * @author GUDONG
 *
 */
public interface IRemindService {

	/**
	 * 
	 * @Date : Nov 25, 2015
	 * @param dto
	 * @return
	 * @throws AppException
	 */
	public List<RemindDto> getRemindListByMemberNameOrMoblieOrCarPlate(RemindDto dto) throws AppException;

	/**
	 * @param dto
	 * @return
	 * @throws AppException
	 */
	public List<RemindDto> getRemindListByMemberNameOrMoblieOrCarPlateFromMenu(RemindDto dto) throws AppException;
	/**
	 * 
	 * @Date : Nov 25, 2015
	 * @param dto
	 * @return
	 * @throws AppException
	 */
	public List<RemindDto> getRemindHistoryList(RemindDto dto) throws AppException;

	/**
	 * 
	 * @Date : Nov 25, 2015
	 * @param dto
	 * @return
	 * @throws AppException
	 */
	public List<RemindDto> getRemindHistoryListByUserAndServiceType(RemindDto dto) throws AppException;

	/**
	 * 
	 * @Date : Nov 25, 2015
	 * @param dto
	 * @return
	 * @throws AppException
	 */
	public void reduceRemindQuantityByDealerId(Long dealerId, Integer quantity) throws AppException;

	/**
	 * 
	 * @Date : Sep 15, 2015
	 * @param appSendFlag
	 * @param wechatSendFlag
	 * @param msgSendFlag
	 * @param dto
	 * @throws AppException
	 */
	public Map<String, Object> sendAllRemindInfo(boolean resend, boolean appSendFlag, boolean wechatSendFlag,
			boolean msgSendFlag, RemindDto dto) throws AppException;
	/**
	 * @param resend
	 * @param appSendFlag
	 * @param wechatSendFlag
	 * @param msgSendFlag
	 * @param dto
	 * @param customerDto
	 * @return
	 * @throws AppException
	 */
	public Map<String, Object> sendAllRemindInfo(boolean resend, boolean appSendFlag, boolean wechatSendFlag,
			boolean msgSendFlag, ServiceRemindForMemberDto serviceRemindForMemberDto,CustomerPromotionDto customerDto) throws AppException;
	
	public Map<String, Object> sendAllRemindInfoForNotice(boolean resend, boolean appSendFlag, boolean wechatSendFlag,
			boolean msgSendFlag, ServiceRemindForMemberDto serviceRemindForMemberDto,CustomerPromotionDto customerDto) throws AppException;

	/**
	 * 
	 * @Date : Sep 15, 2015
	 * @param appSendFlag
	 * @param wechatSendFlag
	 * @param msgSendFlag
	 * @param dto
	 * @throws AppException
	 */
	public Map<String, Object> sendRemindInfoList(boolean resend, boolean appSendFlag, boolean wechatSendFlag,
			boolean msgSendFlag, List<RemindDto> dto) throws AppException;
	
	/**
	 * @param resend
	 * @param appSendFlag
	 * @param wechatSendFlag
	 * @param msgSendFlag
	 * @param dto
	 * @param customerDto
	 * @return
	 * @throws AppException
	 */
	public Map<String, Object> sendServiceRemindInfoList(boolean resend, boolean appSendFlag, boolean wechatSendFlag,
			boolean msgSendFlag, List<RemindDto> dto,CustomerPromotionDto customerDto) throws AppException;
	
	public Map<String, Object> sendServiceRemindInfoListForNotice(boolean resend, boolean appSendFlag, boolean wechatSendFlag,
			boolean msgSendFlag, List<RemindDto> dto,CustomerPromotionDto customerDto) throws AppException;

	/**
	 * 
	 * @Date : Dec 2, 2015
	 * @return
	 * @throws AppException
	 */
	public RemindQuota getRemindQuotaByDealerId(Long dealerId) throws AppException;

	/**
	 * 
	 * @Date : Dec 2, 2015
	 * @return
	 * @throws AppException
	 */
	public List<MsgPackageDto> getLogisticProcessListByDealerIdAndLogisticType(Long dealerId) throws AppException;

	/**
	 * 
	 * @Date : Dec 2, 2015
	 * @return
	 * @throws AppException
	 */
	public List<MsgPackageDto> getLogisticProcessHistoryListByDealerIdAndLogisticType(Long dealerId)
			throws AppException;

	/**
	 * 
	 * @Date : Dec 2, 2015
	 * @return
	 * @throws AppException
	 */
	public Map<String, Object> updateLogisticProcessList(RemindDto dto, Long dealerId) throws AppException;

	/**
	 * 
	 * @Date : Dec 2, 2015
	 * @return
	 * @throws AppException
	 */
	public Map<String, Object> saveRemindSetting(RemindSettingsDto dto) throws AppException;

	/**
	 * @param remindDto
	 * @return
	 * @throws AppException
	 */
	public List<RemindDto> getRemindListByCarPlate(RemindDto remindDto) throws AppException;

	/**
	 * @param file
	 * @throws AppException
	 */
	public void importServiceRemindDataFromFile(File file,String zipName) throws AppException;

	/**
	 * @param carPlate
	 * @param maintenance
	 * @return
	 * @throws AppException
	 */
	public List<ServiceRemind> getServiceRemindByCarPlateAndMaintenance(String carPlate, String maintenance)
			throws AppException;

	/**
	 * @param serviceRemindDto
	 * @return
	 * @throws AppException
	 */
	public ServiceRemind processServiceRemind(ServiceRemindDto serviceRemindDto) throws AppException;

	/**
	 * @param remindDto
	 * @param dealerNum
	 * @throws AppException
	 */
	public void processServiceRemindForShow(RemindDto remindDto, Long dealerNum) throws AppException;

	/**
	 * @throws AppException
	 */
	/*public void processServiceRemindFileSynchronization() throws AppException;*/

	/**
	 * 解析customer文件
	 * 
	 * @throws AppException
	 */
	/*public void processCustomerVehicleFile() throws AppException;*/

	/**
	 * 解析vehicle文件
	 * 
	 * @throws AppException
	 */
	public void processVehicleFile(String localunZipFile) throws AppException;
	
	/**
	 * 解析Customer文件
	 * 
	 * @throws AppException
	 */
	public void processCustomerFile(String localunZipFile) throws AppException;
	
	/**
	 * @throws AppException
	 */
	/*public void processCustomerAndVehicleFile() throws AppException;*/
	
	public void processServiceRemindWithBrakeList(List<ServiceRemind> sRWithBrakeList,String code)throws AppException;
	
	/**
	 * @throws AppException
	 * 处理ServiceCenter文件
	 */
	public void processTenantServiceCenterFile() throws AppException;
	
	/**
	 * 获得所有的文件，并按照时间顺序排序。
	 * @param sftpProperties
	 * @param prefix
	 * @return
	 * @throws Exception
	 */
	public List<SftpFileDto> getAllFileOrderByDateAsc(SftpProperties sftpProperties, String prefix) throws Exception;
	
	/**
	 * serviceRemind2.0
	 * @param dto
	 * @return
	 * @throws AppException
	 */
	public List<ServiceRemindForMemberDto> getRemindListByMemberNameOrMoblieOrCarPlate(ServiceRemindForMemberDto dto) throws AppException;
	
	public List<ServiceRemindForMemberDto> getRemindListForNotice(ServiceRemindForMemberDto dto) throws AppException;
	
	public List<ServiceRemindForMemberDto> getRemindListForCreateCustomerGroup(ServiceRemindForMemberDto dto) throws AppException;
	
	/**
	 * 查找要显示的总店促销
	 * @return
	 * @throws AppException
	 */
	public List<HQPromotion> getHQPromotionByIsSelected(ServiceRemindForMemberDto dto) throws AppException;
	
	/**
	 * 查找要先显示的自定义促销信息
	 * @return
	 * @throws AppException
	 */
	public List<CustomPromotion> getCustomerPromotionByDealerId(Long dealerId,String maintenanceType) throws AppException;
	
	public List<CustomPromotion> getCustomerPromotionByPromotion(Long dealerId,String promotion) throws AppException;
	/**
	 * @param customerPromotion
	 * @throws AppException
	 */
	public void saveCustomerPromotion(CustomPromotion customerPromotion) throws AppException;
	
	/**
	 * @return
	 * @throws AppException
	 */
	public List<ServiceRemind> getAllServiceRemind() throws AppException;
	
	public List<ServiceRemindHistoryDto> getServiceRemindHistoryByMobilePhone(ServiceRemindForMemberDto dto) throws AppException;
	
	public List<CustomerGroup> getTrCustomerGroupByDealerId(Long dealerId) throws AppException;
	
	public boolean saveCustomerGroup(ServiceRemindSubmitDto srDto,ServiceRemindForMemberDto dto,Long dealerId) throws AppException;
	
	public MasterDataDealerInfo getDealerByDealerNum(String dealerNum) throws AppException;
}
